<extend name="Public/base" />
<block name="style">
<style>
	.page-content{padding:15px 10px;}
	.search_pannl_div .single-col label{width:75px;} 
</style>
</block>
<block name="body">
  <include file="Public:artdialog" />

<div class="row">
   <div class="col-md-12">
       <div class="block-web">
   <!-- 商品列表 -->
   <form action="{:U('index')}" method="post"  id="SearchFrom">
           <div class="bgmain">
               <div class="header">
                  <div class="actions_diy">
                           <a href="javascript:;" id="add_edit_id" class="btn btn-default btn-primary">
                               <i class="fa fa-plus"></i>添加特价标题
                           </a>
                  </div>
                   <h3 class="content-header">特价标题列表</h3>
                 </div> 
                   <div class="block-web" style="margin: 0;padding:10px 20px 0px 0px;">
                       <div class="porlets-content">
                           <div class="row" style="margin-left:-45px;">
                               <div class="col-md-12">
                                   <div class="search_pannl_div">
                                       <table class="search_table">
                                           <tbody>
                                               <tr>
                                             <td class="single-col"> 
                                                    <label>关键词：</label><input style="width:120px;" type="text" id="keyword" name="keyword" placeholder="输入关键字" value="">
                                                       <button type="button" class="btn btn-success" formtarget="SearchFrom" id="searchBtn" ><i class="fa fa-search"></i> 搜索</button>  
                                                   </td>
                                               </tr>
                                           </tbody>
                                       </table>
                                   </div>
                               </div>
                           </div>
                       </div>
                   </div>
        </div>

   <div id="load_tb_div" style="padding:10px 0px 30px ;">
     <div class="table-responsive">
            <table id="sample-table-1"
              class="table table-striped table-bordered table-hover">
              <thead>
                <tr>
                  <th class="center"><label>
                  <input type="checkbox" class="ace" id="allsel" > <span class="lbl"></span>
                  </label></th>  
                  <th>主题</th> 
                  <th>状态</th>
                  <th>操作员</th>
                  <th>添加时间</th>
                  <th>操作</th>
                </tr>

              </thead>

              <tbody>
                <volist name="sale" id="o">
                <tr>
                  <td class="center"><label> <input
                      type="checkbox" class="ace"  value="{$o.saleid}" > <span class="lbl"></span>
                  </label></td> 
                  <th>{$o.salename}</th>
                  <th>{$o['isactive'] == 1?'有效':'无效'}</th>
                  <th>{$o.adminname}</th>
                  <th>{$o.createtime}</th> 
                  <td><a
                    class="J_ajax_del btn btn-white btn-sm"
                    href="{:U('delsale',array('id'=>$o['saleid']))}">删除</a>  <a
                    href="javascript:void(0);" onclick="reupdate(this)" field="{:U('add',array('id'=>$o['saleid']))}"
                    class="btn btn-white btn-sm">修改</a> 
                    <a class="J_ajax_del btn btn-white btn-sm" href="{:U('setsale',array('id'=>$o['saleid']))}" msg="当前操作将导致数据的显示情况，是否确定操作？">设置{$o['isactive']==1?'无效':'有效'}</a>
                    <a  href="{:U('Special/add',array('saleid'=>$o['saleid']))}" class="btn btn-white btn-sm">添加特价商品</a></td>
                </tr>
                </volist>
              </tbody>
            </table>
            <div class="pagination" style="margin:0px;">
               <a class="btn pull-left btn-danger" id="pdid">批量删除</a> {$page}
            </div>
          </div> 
   </div>
           </form>
       </div><!--/porlets-content-->
   </div><!--/block-web-->
</div><!--/col-md-12-->
</block>
<block name="script">
<script type="text/javascript" src="__PUBLIC__/Admin/js/common_manage.js"></script>
<script type="text/javascript">
var pdelurl="{:U('delsale')}";
$(function(){
//debugger;
   $("#add_edit_id").bind("click",fnadd);
   $("#searchBtn").bind("click",function(){$("#SearchFrom").submit();})
   $("#pdid").bind("click",fndel);
   $("#allsel").bind("click",checkSel);
 });

 var id,fn;
 var fnadd = function(){
   //debugger;
    var url="{:U('add')}";
    title="添加特价主题";
    _es_openDilog(url, title, "1200px", "80%", true, 0.2, "add_edit_id");
 }
 
 var reupdate=function(obj){ 
	 //debugger;
	 var url=$(obj).attr("field");
	 if(!url)return false;
	 title="修改特价主题";
	 _es_openDilog(url, title, "1200px", "80%", true, 0.2, "add_edit_id");
 } 

 </script>
</block>
